﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddDonThu.ascx.cs" Inherits="CMS.Web.CompDenu.AddDonThu" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<center>
<table width="96%" class="Table_Border" align="center" style="border-collapse: collapse" cellSpacing="0" cellPadding="0" border="0">
    <tr><td valign="middle" align="center" height="30px"><span id="lblTitle" runat="server" class="Title">CẬP NHẬT ĐƠN THƯ</span></td>
    </tr>    
    <tr id="rowMess" runat="server">
        <td valign="middle" align="left" height="30px">
            <span id="lblMess" runat="server" class="Grid_Error"></span>
        </td>
    </tr>    
    <tr>
        <td width="100%" valign=top align=center>
        <div style="border:1px solid #0b73f4;width:100%;height:atuo;">
			<table id="tblNew" class="Table_Border" style="border-collapse: collapse" cellspacing="2" cellpadding="0" width="99%" align="center" border="0">
                <tr>
		            <td class="Col_Left" width="21%">Số thụ lý:</TD>
			        <td class="Col_Right" width="15%">
			        	<asp:textbox id="txtSoThuLy" runat="server" CssClass="TextBox" Width="90%" MaxLength="20"></asp:textbox>
                    </td>
                    <td class="" width="14%" style="text-align:right; font-weight:bold;">Đơn đề ngày:</TD>
			        <td class="Col_Right" width="16%">
			        	<asp:textbox id="txtDonDeNgay" runat="server" CssClass="TextBox" Width="75%" MaxLength="10" Enabled="true"></asp:textbox>
			        	
                    </td>
					<td class="Col_Left" width="14%">Ngày nhận <FONT color="#ff0000">(*)</FONT>:</TD>
			        <td class="Col_Right" width="15%">
			        	<asp:textbox id="txtNgayGui" runat="server" CssClass="TextBox" Width="74%" MaxLength="10" Enabled="true"></asp:textbox>
			        	
                    </td>
                </tr>
                <tr>
		            <td class="Col_Left">Họ và tên <FONT color="#ff0000">(*):</FONT></TD>
			        <td class="Col_Right" colspan="2">
			            <asp:textbox id="txtHoTen" Runat="server" TextMode=MultiLine Rows="3" Width="90%" CssClass="TextArea"></asp:textbox>&nbsp;<img src="Images/scroll2.png" style="cursor: pointer;" onclick="openSelectNguoiGuiWindow('<% =txtHoTen.ClientID%>','<%=hidNguoiGui.ClientID %>');" />
			        	<asp:HiddenField ID="hidNguoiGui" runat="server" Value="0" />
                    </td>
                    <td class="Col_Left" style="text-align:right;">Lần gửi <FONT color="#ff0000">(*)</FONT>:</TD>
			        <td class="Col_Right" colspan="2" style="vertical-align:top;">
			        	<asp:textbox id="txtLanGui" runat="server" CssClass="TextBox" Width="30%" MaxLength="8"></asp:textbox>
                    </td>
                </tr>
                <tr>
		            <td class="Col_Left">Địa chỉ:</TD>
			        <td class="Col_Right" colspan="2">
                        <asp:textbox id="txtDiaChi" runat="server" CssClass="TextArea" TextMode=MultiLine Rows="3" Width="100%"></asp:textbox>
                    </td>
                    <td class="Col_Left" style="text-align:right;">Tập thể đề đơn:</TD>
			        <td class="Col_Right" colspan="2">
			            <asp:textbox id="txtDSTapTheDeDon" Runat="server" TextMode=MultiLine Rows="3" Width="99%" CssClass="TextArea"></asp:textbox>
			        </td>
                </tr>
                <tr>
		            <td class="Col_Left">Loại hình:</td>
			        <td class="Col_Right" colspan="2" style="vertical-align:top;">
			            <asp:DropDownList ID="drpLoaiHinh" runat="server" CssClass="ListBox" Width="99%">
                            <asp:ListItem Value=""></asp:ListItem>
                            <asp:ListItem Value="0">Cá nhân</asp:ListItem>
                            <asp:ListItem Value="1">Tập thể</asp:ListItem>
                        </asp:DropDownList>			        
                    </td>
                    <td class="Col_Left" style="text-align:right;">Địa bàn xảy ra vụ việc <FONT color="#ff0000">(*)</FONT>:</TD>
			        <td class="Col_Right" colspan="2">
			        <asp:textbox id="drpDiaBan" runat="server" CssClass="TextBox" Width="90%" MaxLength="250"></asp:textbox>
			            <img src="Images/scroll2.png" style="display:; cursor: pointer; cursor: hand;" onclick="openSelectDiaBanWindow('<% =drpDiaBan.ClientID%>','<%=hidDiaBan.ClientID %>');" />
			            <asp:HiddenField ID="hidDiaBan" runat="server" />
			            
                    </td>
                </tr>
                <tr>
		            <td class="Col_Left">Nguồn tiếp nhận:</TD>
			        <td class="Col_Right" colspan="2">
			            <asp:DropDownList ID="drpNguonTiepDon" runat="server" CssClass="ListBox" Width="99%"></asp:DropDownList>	
                    </td>
                    <td class="Col_Left" style="text-align:right;">Người nhận đơn:</TD>
			        <td class="Col_Right" colspan="2">
			            <asp:textbox id="txtNguoiNhanDon" runat="server" CssClass="TextBox" Width="99%"></asp:textbox>
                    </td>
                </tr>                
                <tr>
		            <td class="Col_Left">Loại đơn:</TD>
			        <td class="Col_Right" colspan="2">
			        	<asp:DropDownList ID="drpLoaiDon" runat="server" CssClass="ListBox" Width="99%" DataTextField="TenLoaiDon" DataValueField="ID"></asp:DropDownList>
                    </td>
                    <td class="Col_Left" style="text-align:right;">Lĩnh vực:</TD>
			        <td class="Col_Right" colspan="2">
			        	<asp:DropDownList ID="drpLinhVuc" runat="server" CssClass="ListBox" Width="100%" DataTextField="TenLinhVuc" DataValueField="ID"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
		            <td class="Col_Left">Đơn vị chuyển đơn đến:</TD>
			        <td class="Col_Right" colspan="5"><asp:textbox id="txtNoiDen" runat="server" CssClass="TextBox" Width="99%"></asp:textbox>
                    </td>
                </tr>
                <tr>
		            <td class="Col_Left">Tóm tắt nội dung  <FONT color="#ff0000">(*):</TD>
			        <td class="Col_Right" colspan="5">
                        <fckeditorv2:fckeditor id="txtTomTat" runat="server" ToolbarSet='Basic' Height="200px" Width="98%" BasePath="~/FCKeditor/"/>			        
                        <%--<asp:textbox id="txtTomTat" Runat="server" TextMode=MultiLine Rows="5" Width="99%" CssClass="TextArea"></asp:textbox>--%>
                    </td>
                </tr>                
                 </table>
            </div>
            <table style="border-collapse: collapse" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
				<tr>
				    <td height="40" align="left" style="width:70%;">
                        <asp:button style="display:none" id="btnOK" runat="server" CssClass="Button" Text="Cập nhật" OnClick="btnOK_Click"></asp:button>
                        <asp:button style="display:none" id="btnOKC" runat="server" CssClass="Button" Text="C&#7853;p nh&#7853;t và ti&#7871;p t&#7909;c" OnClick="btnOKC_Click"></asp:button>
                    </td>
                    <td align="right">
                        <asp:HiddenField ID="hidNguoiNhan" runat="server" />
                        <asp:HiddenField ID="hidNguoiXuLy" runat="server" />
                        <asp:HiddenField ID="hidNguoiChuyen" runat="server" />
                        <input type="button" class="Button" onclick="CheckInput('<%=ID%>');" value="  Lưu lại  " id="Button2" />
                        <input type="reset" class="Button" value="Nhập lại" id="btnReset" />
                        <input type="button" class="Button" value="Hủy bỏ" id="btCancel" onclick="CancelForm()" />
                    </td>
				</tr>
	        </table>
		</td>
    </tr>
</table>
</center>
<script type="text/javascript" language="javascript">

    var _currentDate = "<%=DateTime.Now.ToString("dd/MM/yyyy") %>";    
    jQuery(function($){
        $("#<%=txtDonDeNgay.ClientID %>").datepicker();
        $("#<%=txtNgayGui.ClientID %>").datepicker();
    });   

    function removeListId(src, id){
        var result = src;
        result = (','+ result).replace(','+id,'');
        if(result.length>2){
            result = result.substr(1);    
        }else{
            result = '';
        }
        return result;
    }               
    function CancelForm(){
      document.location.href= "<%=FullBaseUrl %>?tabID=1&fName=16";
    }
    
    function CheckInput(ID){
        CheckInput_callback("")
    }
    
    function CheckInput_callback(res){        
        strMsg = "";
        //strMsg += isValid("<%=txtSoThuLy.ClientID %>",6,1,number,0,0,"Số thụ lý");
        var firstChar = document.getElementById("<%=txtHoTen.ClientID %>").value;
        firstChar = firstChar.substring(0, 1);
        strMsg += isValid("<%=txtHoTen.ClientID %>",128,1,spec,1,0,"Họ và tên");
        strMsg += isValid("<%=txtLanGui.ClientID %>",2,1,number,0,0,"Lần gửi");
        strMsg += isValid("<%=drpDiaBan.ClientID %>",256,1,spec,1,0,"Địa bàn");
        
        
        if (strMsg!=""){
            strMsg = strMsg.substr(1);
            alert(strMsg);
            window.returnValue = false;
            return false;
        }
        else{
            document.getElementById('<%=btnOK.ClientID %>').click();
        }
        return false;
    }
    
</script>